package com.zgjkhis.modules.statistics.domain;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zgjkhis.modules.system.domain.Drug;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yxl
 * @Description
 * @Date 2021/12/23 18:01
 **/
@Data
@TableName("his_drug_statistics")
public class DrugStatistics implements Serializable {

    @TableId
    private Long id;
    @ApiModelProperty(value = "药品id")
    private Long drugId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "归档时间")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "归档日期")
    private Date pigeonholeTime;
    @ApiModelProperty(value = "销量")
    private Integer quantity;
    @ApiModelProperty(value = "销售额")
    private BigDecimal price;
    @ApiModelProperty(value = "利润")
    private BigDecimal profit;
    @ApiModelProperty(value = "成本")
    private BigDecimal costPrice;
    @ApiModelProperty(value = "门店id")
    private String pharmacyId;

    public void copy(Drug drug) {
        Date createTime = this.createTime;
        Long id = this.id;
        BeanUtil.copyProperties(drug, this);
        this.createTime = createTime;
        this.id = id;
    }

}
